package com.superhero.common.pojo.vo.website;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.superhero.common.pojo.vo.ValidatedGroup.Insert;
import com.superhero.common.pojo.vo.ValidatedGroup.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;


@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "HouseholdInput", description = "住户信息列表入参封装")
public class HouseholdInput {

    @NotNull(groups = {Update.class}, message = "管理员ID不允许为空")
    @ApiModelProperty(name = "id", value = "管理员ID", dataType = "Integer", required = true)
    private Integer id;

    @ApiModelProperty(name = "username", value = "用户名", dataType = "String", required = false)
    private String username;

    @NotNull(groups = {Insert.class}, message = "真实姓名不允许为空")
    @ApiModelProperty(name = "realName", value = "真实姓名", dataType = "String", required = true)
    private String realName;

    @NotNull(groups = {Insert.class}, message = "密码不允许为空")
    @ApiModelProperty(name = "password", value = "密码", dataType = "String", required = true)
    private String password;

    @NotNull(groups = {Insert.class}, message = "手机号不允许为空")
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$", message = "手机号不符合规范")
    @ApiModelProperty(name = "phone", value = "手机号", dataType = "String", required = true)
    private String phone;

}
